package com.ruoyi.info.service.impl;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.ruoyi.info.mapper.InfoTeacherMapper;
import com.ruoyi.info.domain.InfoTeacher;
import com.ruoyi.info.service.IInfoTeacherService;

import java.util.List;

/**
 * 教职工Service业务层处理
 *
 * @author ruoyi
 * @date 2024-09-23
 */
@Service
public class InfoTeacherServiceImpl extends ServiceImpl<InfoTeacherMapper, InfoTeacher> implements IInfoTeacherService {

    @Override
    public List<InfoTeacher> queryList(InfoTeacher infoTeacher) {
        LambdaQueryWrapper<InfoTeacher> lqw = Wrappers.lambdaQuery();
        if (StringUtils.isNotBlank(infoTeacher.getTeacherName())){
            lqw.like(InfoTeacher::getTeacherName ,infoTeacher.getTeacherName());
        }
        if (StringUtils.isNotBlank(infoTeacher.getTeacherNo())){
            lqw.eq(InfoTeacher::getTeacherNo ,infoTeacher.getTeacherNo());
        }
        if (StringUtils.isNotBlank(infoTeacher.getDeptCode())){
            lqw.eq(InfoTeacher::getDeptCode ,infoTeacher.getDeptCode());
        }
        return this.list(lqw);
    }

}